using System;
using System.Collections;

namespace Sedna.Core.Persistence
{
	/// <summary>
	/// this interface represents the reqult of a query created either by means of a HQL request
	/// or NHibernate ICriteria. Apart from a data collection that contains request result
	/// this structure has also a number of total result that can be return from the underlying
	/// database. This value is very important for Grid paging organisation.
	/// </summary>
	public interface IQueryResult
	{
		/// <summary>
		/// collection that represernts the result set
		/// </summary>
		ICollection Data
		{
			get;
		}

		/// <summary>
		/// total count of data items (usually not equals to Data.Count)
		/// that satisfy the defined criteria and can be returned from the
		/// underlying DB
		/// </summary>
		int TotalCount
		{
			get;
		}

		/// <summary>
		/// A flag that shows if a TotalCount represents a valid
		/// value. The point is that not for every request a TotalCount
		/// value can be determined. In this case this flag is false.
		/// </summary>
		bool IsTotalCountDefined
		{
			get;
		}

	}
}
